package com.example.livedata;

import androidx.appcompat.app.AppCompatActivity;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MediatorLiveData;
import androidx.lifecycle.Observer;

import android.os.Bundle;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        MediatorLiveData<String> stringMediatorLiveData = new MediatorLiveData<>();
        stringMediatorLiveData.observe(this, new Observer<String>() {
            @Override
            public void onChanged(String s) {

            }
        });
        stringMediatorLiveData.postValue("12");
    }
}